/*
* @Author: yongqiang.sun
* @Date:   2018-01-13 18:13:42
* @Last Modified by:   yongqiang.sun
* @Last Modified time: 2018-01-13 18:24:56
*/

(function (window) {
    var $ = window.Zepto || window.jQuery;
    var amount = 100; // 默认充值金额
    function initRecharge(amount) {
        $('.denomination .deno-item').each(function (index, item) {
            if ($(item).attr('data-amount') == amount) {
                $(item).addClass('deno-item-active');
            } else {
                $(item).removeClass('deno-item-active');
            }
        })
    }
    $(window.document).ready(function () {
        initRecharge(amount);
        // 充值面额点击事件
        $('.denomination .deno-item').click(function () {
            var $this = $(this);
            amount = $this.attr('data-amount');
            $this.addClass('deno-item-active').siblings().removeClass('deno-item-active');
        })

        // 充值按钮点击事件
        $('#wxPay').click(function () {
            alert(amount);
        })
    })
})(window)